package com.framework.modules.base.service;

import java.util.Map;

import com.baomidou.mybatisplus.service.IService;
import com.framework.common.utils.PageUtils;
import com.framework.common.utils.R;
import com.framework.common.utils.ResponseCode;
import com.framework.form.RegisterForm;
import com.framework.modules.base.entity.UserEntity;
import com.framework.form.LoginForm;

/**
 * 用户
 */
public interface UserService extends IService<UserEntity> {

	PageUtils queryPage(Map<String, Object> params);

	/**
	 * 通过手机号码查询用户是否注册成功
	 * @param mobile
	 * @return
	 */
	UserEntity queryByMobile(String mobile);

	/**
	 * 根据用户查询用户信息
	 * @param username
	 * @return
	 */
	UserEntity queryByUsername(String username);



	/**
	 * 用户登录
	 * 
	 * @param form 登录表单
	 * @return 返回登录信息
	 */
	Map<String, Object> login(LoginForm form);

	/**
	 * 用户注册
	 * @param form 注册表单
	 * @return
	 */
	Long register(RegisterForm form);


	Integer insertAndGetUserId(UserEntity entity);

	/**
	 * 更换手机号
	 * @param uid
	 * @param mobile
	 * @return
	 */
	Object updateMobile(Long uid,String mobile);


	/**
	 * 发送礼物
	 * @param uid
	 * @param quantity
	 * @param targetUid
	 * @return
	 */
	ResponseCode sendGift(Long uid, String giftId, Integer quantity, String targetUid);

	/**
	 * 直播间送礼物
	 * @param uid
	 * @param quantity
	 * @param targetUid
	 * @return
	 */
	ResponseCode sendGift2LiveRoom(Long uid, Integer giftId, Integer quantity, String targetUid);

	/**
	 * 发送包裹礼物
	 * @param uid
	 * @param quantity
	 * @param targetUid
	 * @return
	 */
	ResponseCode sendUserGift(Long uid, String giftId, Integer quantity, String targetUid);

	Object statAttentInfo(Long uid);
}
